﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Xml;

namespace CNVP.Config
{
    /// <summary>
    /// 产品信息
    /// </summary>
    public class VerConfig
    {
        /// <summary>
        /// 封装的XML配置文件操作对象
        /// </summary>
        private static BaseXmlCtrl xml = new BaseXmlCtrl();

        /// <summary>
        /// 配置文件名称
        /// </summary>
        private static String xmlFileName = "SystemInfo";
        /// <summary>
        /// 读取指定项目下的值
        /// </summary>
        /// <param name="itemName">项目名</param>
        /// <returns>值</returns>
        private static String GetSingle(String itemName)
        {
            xml.XmlPath = xmlFileName;
            return xml.GetSingle(String.Format("SystemInfo/{0}", itemName));
        }
        /// <summary>
        /// 软件版本信息
        /// </summary>
        public static String Version = GetSingle("Version");
        /// <summary>
        /// 软件发布时间
        /// </summary>
        public static String PubTime = GetSingle("PubTime");
        /// <summary>
        /// 软件版权信息
        /// </summary>
        public static String CopyRight = GetSingle("CopyRight");
        /// <summary>
        /// 软件名称
        /// </summary>
        public static String Product = GetSingle("Product");
        /// <summary>
        /// 软件代号
        /// </summary>
        public static String ProductIdentify = GetSingle("ProductIdentify");
        /// <summary>
        /// 保存配置信息
        /// </summary>
        /// <param name="strTarget">目标标签</param>
        /// <param name="strValue">标签值</param>
        public static void SaveXmlConfig(String strTarget, String strValue)
        {
            xml.XmlPath = xmlFileName;
            xml.SaveXmlConfig(strTarget, strValue);
        }
    }
}